package com.ruike.alisurface.https;

import com.ruike.alisurface.utils.ShareKey;
import com.voodoo.lib_http.ApiListener;
import com.voodoo.lib_http.ApiTools;
import com.voodoo.lib_utils.SharedUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * Author: voodoo
 * CreateDate: 2023/12/26 026上午 10:27
 * Description: 鄂尔多斯接口
 */
public class OtherHttp {

    // 获取新的二维码
    public static final String GET_ORDER_QR_CODE_URL = "https://rk.shouhuojiyun.com/otherApi/eerduosi/get_order_qr";
    // 订单出货情况上报
    public static final String END_ORDER_URL = "https://rk.shouhuojiyun.com/otherapi/eerduosi/end_order";

    /**
     * 获取支付二维码
     *
     * @param orderId      订单编号
     * @param mApiListener 回调监听
     */
    public static void getOrderQrCode(String orderId, ApiListener mApiListener) {
        Map<String, Object> map = new HashMap<>();
        map.put("mchid", SharedUtils.getInstance().getString(ShareKey.MCH_ID, ""));
        map.put("cmd_id", SharedUtils.getInstance().getString("cmd_id", ""));
        map.put("orderId", orderId);
        ApiTools.getInstance().get(GET_ORDER_QR_CODE_URL, map, mApiListener);
    }

    /**
     * 上报出货详情
     *
     * @param orderId      订单编号
     * @param isEnd        是否出货
     * @param remark       备注
     * @param mApiListener 回调监听
     */
    public static void endOrder(String orderId, boolean isEnd, String remark, ApiListener mApiListener) {
        Map<String, Object> map = new HashMap<>();
        map.put("order_id", orderId);
        map.put("isEnd", orderId);
        map.put("remark", orderId);
        map.put("mchid", SharedUtils.getInstance().getString(ShareKey.MCH_ID, ""));
        ApiTools.getInstance().get(END_ORDER_URL, map, mApiListener);
    }

}
